package com.itheima.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.pojo.EmpLog;
import com.itheima.service.EmpLogService;
import com.itheima.mapper.EmpLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
* @author ch200
* @description 针对表【emp_log(员工日志表)】的数据库操作Service实现
* @createDate 2025-03-15 13:56:41
*/
@Service
public class EmpLogServiceImpl extends ServiceImpl<EmpLogMapper, EmpLog>
    implements EmpLogService{
    @Autowired
    private EmpLogMapper empLogMapper;
    @Transactional(propagation = Propagation.REQUIRES_NEW) //需要在一个新的事务中运行
    @Override
    public void insertLog(EmpLog empLog) {
        empLogMapper.insert(empLog);
    }
}




